rgr22@boulderdash.cl.cam.ac.uk
rn@wyvis.camb.intel-research.net
rn@wyvis.research.intel-research.net
+rneugeba@wyvis.research
rneugeba@wyvis.research.intel-research.net
smh22@boulderdash.cl.cam.ac.uk
smh22@labyrinth.cl.cam.ac.uk
now = NOW();
- /* remove timer, if till on list */
+ /* remove timer, if still on list */
rem_ac_timer(&schedule_data[this_cpu].s_timer);
/* deschedule the current domain */
next_prime_evt = 0xffffffff;
min_avt = 0xffffffff; /* to calculate svt */
-
list_for_each(tmp, &schedule_data[this_cpu].runqueue) {
p = list_entry(tmp, struct task_struct, run_list);
if (p->evt < next_evt) {
/* update system virtual time */
if (min_avt != 0xffffffff) schedule_data[this_cpu].svt = min_avt;
+ /* check for virtual time overrun on this cpu */
+ if (schedule_data[this_cpu].svt >= 0xf0000000) {
+ u_long t_flags;
+ write_lock_irqsave(&tasklist_lock, t_flags);
+ p = &idle0_task;
+ do {
+ if (p->processor == this_cpu && !is_idle_task(p)) {
+ p->evt -= 0xe0000000;
+ p->avt -= 0xe0000000;
+ }
+ } while ( (p = p->next_task) != &idle0_task );
+ write_unlock_irqrestore(&tasklist_lock, t_flags);
+ schedule_data[this_cpu].svt -= 0xe0000000;
+ }
+
+ /* work out time for next run through scheduler */
if (is_idle_task(next)) {
r_time = ctx_allow;
goto sched_done;
spin_unlock_irq(&schedule_data[this_cpu].lock);
+ /* done, switch tasks */
if ( unlikely(prev == next) )
{
/* We won't go through the normal tail, so do this by hand */
s_time_t wokenup; /* time domain got woken up */
unsigned long mcu_advance; /* inverse of weight */
- s32 avt; /* actual virtual time */
- s32 evt; /* effective virtual time */
+ u32 avt; /* actual virtual time */
+ u32 evt; /* effective virtual time */
int warpback; /* warp? */
long warp; /* virtual time warp */
long warpl; /* warp limit */